package com.atxiaodei.alibabaseata.controller;

import com.atxiaodei.alibabaseata.entity.CommonResult;
import com.atxiaodei.alibabaseata.service.StorageService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName StorageController
 * @Deacription TODO
 * @Author 王盟
 * @Date 2021/3/1 10:24
 * @Version 1.0
 **/
@RestController
public class StorageController {

    @Resource
    private StorageService storageService;

    @RequestMapping("/storage/decrease")
    public CommonResult decrease(Long productId, Integer count) {
        storageService.decrease(productId, count);
        return new CommonResult(200,"扣减库存成功!");
    }
}
